]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace: don't use multiple later calls to propagate actualGeometry calls
authorGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 22 May 2013 17:27:17 +0000 (19:27 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 23 May 2013 16:10:50 +0000 (18:10 +0200)
Meta laters are invoked in reverse order of registration, so
having multiple laters propagating the geometry cause all but the
first one in the frame (which is usually wrong) to be ignored.
Instead, queue at most one later call, and use the last set geometry
in the callback.

https://bugzilla.gnome.org/show_bug.cgi?id=700853

js/ui/workspace.js

index bf5d277cf6f9882e6e62711bc539b093d5d80cae..713750423eafa8ca457e61bbb38dbd5d859747f1 100644 (file)
@@ -989,10 +989,17 @@ const Workspace = new Lang.Class({
     setActualGeometry: function(geom) {
         this._actualGeometry = geom;
 
-        Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
+        if (this._actualGeometryLater)
+            return;
+
+        this._actualGeometryLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
+            let geom = this._actualGeometry;
+
             this._dropRect.set_position(geom.x, geom.y);
             this._dropRect.set_size(geom.width, geom.height);
             this._updateWindowPositions(WindowPositionFlags.NONE);
+
+            this._actualGeometryLater = 0;
             return false;
         }));
     },